﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Pixysoft.Framework.Noebe.MemoryCaches
{
    public interface ICacheDataSet
    {
        bool Contains(string settingName, string sqlValue);

        bool Contains(string settingName, string sqlValue, string key);


        ICacheDataTable CreateCache(string settingName, string sqlValue, DataTable schema);

        ICacheDataTable CreateCache(string settingName, string sqlValue, DataTable schema, int capacity);

        ICacheDataTable GetCache(string settingName, string sqlValue);

        DataTable GetCache(string settingName, string sqlValue, string key);
        
        DataTable GetCacheTable(string tablename);

        /// <summary>
        /// 直接删除table
        /// </summary>
        /// <param name="tablename"></param>
        void RemoveTable(string tablename);

        /// <summary>
        /// 清除table的数据
        /// </summary>
        /// <param name="tablename"></param>
        void ClearTable(string tablename);

        /// <summary>
        /// 清除table指定sqlvalue的数据 一般指定SQL后使用 没有指定参数 所以是泛指
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="sqlValue"></param>
        void Clear(string settingName, string sqlValue);

        /// <summary>
        /// 清除table指定sql，并且指定paramter值的数据
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="sqlValue"></param>
        /// <param name="key"></param>
        void Clear(string settingName, string sqlValue, string key);


        void ClearAll();

        bool Verify();
    }
}
